package com.burgeon.backend.SHOP.controller;

import com.burgeon.backend.SHOP.entity.couponGift.CouponGiftVO;
import com.burgeon.backend.SHOP.service.AppCouponGiftService;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpSession;
import java.util.List;


/**
 * 套券
 */
@RestController
@RequestMapping("shop/coupongift")
public class APPCouponGiftController extends BaseController {
    @Autowired
    private AppCouponGiftService appCouponGiftService;

    @RequestMapping("data")
    public ResponseResult<List<CouponGiftVO>> Data(HttpSession session) {
        String token = session.getAttribute("token").toString();
        List<CouponGiftVO> data = appCouponGiftService.conversionData(token);
        return new ResponseResult<>(SUCCESS,data);
    }

    /**
     * 积分兑换套券
     * @param session
     * @return
     */
    @RequestMapping("conversion")
    public ResponseResult<List<CouponGiftVO>> conversion(HttpSession session) {
        String token = session.getAttribute("token").toString();

        return new ResponseResult<>(SUCCESS);
    }



}
